package com.electric.qrapp.ui.base.act

import android.annotation.SuppressLint
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding

/**
 *@author created by WA03675
 *@date  2021-08-02 13:40
 *@des
 */
abstract class BaseActivity<T : ViewDataBinding> : SimpleActivity() {
    @SuppressLint
    protected lateinit var dataBinding: T


    protected open fun initDateBinding() {
        dataBinding = DataBindingUtil.setContentView(mActivity, getLayoutId())

        dataBinding.lifecycleOwner = this
    }


    override fun initFirst() {
        initDateBinding()
        setBindingData()

    }

    final override fun useDataBinding(): Boolean = true


    /*
     *dataBinding 数据
     */
    abstract fun setBindingData()



}